<?php
    $id = $_GET['id'];
    $con = mysqli_connect('localhost','root','123456','table');

    $sql = "DELETE FROM `datas` WHERE `id` = '$id'";

    $res = mysqli_query($con,$sql);
    
    if(!$res){
        die("数据库出错" . mysqli_error($con));
    }

    if($res){
        $arr = array("code"=>1,"msg"=>"数据删除成功");
        print_r(json_encode($arr,JSON_UNESCAPED_UNICODE));
    }
?>